﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CUREDataAccessLayers;
using CUREEntity;
using System.Data;
using CUREEntity.SystemManagement;

namespace CUREBusinessLogicLayer
{
    public class EventLogBll
    {
        EventLogDal eventlogdal = new EventLogDal();
        /// <summary>
        /// 获取日志信息信息
        /// </summary>
        /// <param name="where">字典参数</param>
        /// <param name="pageIndex">当前页的索引</param>
        /// <param name="pageSize">每页显示的条数</param>
        /// <param name="totalRecordCount">总记录数</param>
        /// <param name="totalPageCount">总页数</param>
        /// <returns></returns>
        public DataSet GetEventLogData(IDictionary<string, object> where, int pageIndex, int pageSize, out int totalRecordCount, out int totalPageCount)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = eventlogdal.GetEventLogData(where, pageIndex, pageSize, out totalRecordCount, out totalPageCount);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return ds;
        }


        /// <summary>
        /// 插入日志信息
        /// </summary>
        /// <param name="where">字典参数</param>
        /// <returns>true 插入成功/false 插入失败</returns>
        public bool InsertEventLog(IDictionary<string, object> where)
        {
            bool result = false;
            try
            {
                result = eventlogdal.InsertEventLog(where);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return result;
        }

        /// <summary>
        /// 向EVENTLOG日志表添加数据  
        /// </summary>
        /// <param name="eventlog"></param>
        /// <returns></returns>
        public bool AddEventLogin(EventLogModel eventlog)
        {
            return eventlogdal.InsertEventLogin(eventlog);
        }
    }
}
